package com.dream.banana.redis.pack.ipackitem;

/**
 * 躲了一辈子雨，雨会不会很难过。
 * </p>
 * Created by zhumenglong on 2017/5/28.
 */
public interface IRedisStringPack {
    String get(String arg0);

    byte[] get(byte[] arg0);

    String set(String arg0, String arg1);

    String set(String arg0, String arg1, IRedisStringPack.NXXXEnum arg2);

    String set(String arg0, String arg1, IRedisStringPack.NXXXEnum arg2, IRedisStringPack.EXPXEnum arg3, int arg4);

    String set(String arg0, String arg1, IRedisStringPack.NXXXEnum arg2, IRedisStringPack.EXPXEnum arg3, long arg4);

    String set(byte[] arg0, byte[] arg1);

    String set(byte[] arg0, byte[] arg1, IRedisStringPack.NXXXEnum arg2);

    String set(byte[] arg0, byte[] arg1, IRedisStringPack.NXXXEnum arg2, IRedisStringPack.EXPXEnum arg3, int arg4);

    String set(byte[] arg0, byte[] arg1, IRedisStringPack.NXXXEnum arg2, IRedisStringPack.EXPXEnum arg3, long arg4);

    String setex(String arg0, String arg1, int arg2);

    String setex(byte[] arg0, byte[] arg1, int arg2);

    /**
     * EX seconds：设置key的过时时间，单位为秒</p>
     * PX milliseconds：设置key的过期时间，单位为毫秒
     */
    enum EXPXEnum {
        EX, PX;
    }

    /**
     * NX:(IF NOT EXIST) 只有key不存在的时候才会设置key的值</p>
     * XX:只有key存在的时候才会设置key的值
     */
    enum NXXXEnum {
        NX, XX;
    }
}
